package com.henghong.CouponDemo.controller;

import com.henghong.CouponDemo.dto.UpdateCouponDTO;
import com.henghong.CouponDemo.result.Result;
import com.henghong.CouponDemo.service.UpdateCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * created by bishukai on 2025/02/25
 */
@RestController
@RequestMapping("/maintenance")
@Slf4j
@Api(tags = "优惠券详情更新接口")
public class UpdateCouponController {

    @Autowired
    private UpdateCouponService updateCouponService;

    @PutMapping("/updateCoupon")
    @ApiOperation(value = "更新优惠券详情")
    public Result<String> updateCoupon(@RequestBody UpdateCouponDTO updateCouponDTO) {
        log.info("开始更新优惠券详情");
        updateCouponService.updateCoupon(updateCouponDTO);
        return Result.success();
    }


}
